import { useLocation } from "react-router-dom";

function useTitle() {
    let title = ""
    const location = useLocation()

    switch (location.pathname) {
        case "/":
            title = "首页"
            break
        case "/goods":
            title = "商品"
            break
        case "/record":
            title = "记录"
            break
        case "/help":
            title = "帮助"
            break
        case "/getmoney":
            title = "提现"
            break
    }
    return [title]
}

export { useTitle }